Stable Isotope Mixing Models for Dietary Reconstruction

Module 3 · Hands-On ReSources Tutorial · 10:45–12:00

Author

Archaeological Isotope Laboratory

Published

19 February 2026


One-Day Training Programme  |  Practical Session 10:45–12:00

1 Hands-On ReSources Tutorial

This module provides a step-by-step walkthrough of the ReSources graphical user interface (GUI), based on the official ReSources training video. By working through this practical session, you will learn how to:

  • Configure core model options (routing, priors, MCMC settings)
  • Import and validate data tables (consumers, sources, components, concentrations)
  • Understand the role of isotopic offsets (fractionation factors)
  • Run Bayesian MCMC simulations and check convergence
  • Interpret posterior distributions and credible intervals
  • Perform sensitivity analyses and export results
Before you begin

Ensure you have:

  • R ≥ 4.0 installed

  • JAGS ≥ 4.3 installed (download from https://mcmc-jags.sourceforge.io/)

  • ReSources package installed from GitHub:

    devtools::install_github("EISALab/ReSources")
  • Example datasets (available from the ReSources GitHub repository)


2 Launching ReSources and Loading an Example

2.1 Starting the GUI

Code
# Load the package
library(ReSources)

# Launch the graphical user interface
ReSources_GUI()

The ReSources GUI will open in your default web browser. The interface is organized into several tabs:

  • Core Model Options — select model type, priors, MCMC settings
  • Data — enter consumer, source, component, and concentration data
  • Model Characteristics — simulate mixing spaces and assess model feasibility
  • User Estimates — define custom dietary groupings and apply constraints
  • Results — view posteriors, convergence diagnostics, and goodness-of-fit

2.2 Loading a Predefined Example

For this tutorial, we will use the “Five Sources Data Example” included with ReSources.

STEP 1: In the GUI, locate the “Load Example” dropdown menu (typically in the top-left or sidebar)

STEP 2: Select Five Sources Data Example

STEP 3: Click “Load”

This example contains:

  • 5 consumers (individuals with isotope measurements)
  • 5 dietary sources (herbivores, carnivores, plants, fish 1, fish 2)
  • 2 isotope proxies (carbon, nitrogen)
  • 2 components (protein, energy)
  • Concentrations for protein and energy in each source

3 Core Model Options

Navigate to the Core Model Options tab. This is where you configure the fundamental structure of your mixing model.

3.1 Model Type Selection

ReSources offers five model types (we will not detail all five here, but focus on the most common):

Table 1: ReSources model types
Model type Description When to use
Independent targets Each consumer analyzed separately Standard approach for most archaeological studies
Covariate model (categorical) Group-level effects (e.g., sex, status) When comparing groups within a population
Covariate model (numerical) Continuous predictors (e.g., age) When modeling trends with continuous variables
Pooled targets All consumers share a common diet When assuming population-level homogeneity
Hierarchical Nested structure (e.g., individuals within sites) Multi-level studies

For this tutorial: Leave the model type as “Independent targets” (default)

3.2 Minimum Uncertainty

Some input values require a mean and standard deviation (e.g., source isotope values). If you leave the standard deviation blank, ReSources will assign this minimum uncertainty value by default.

Recommended value: 0.1 ‰ for isotope measurements (reflects typical analytical precision)

3.3 Include Components?

Components represent the different macronutrient fractions (protein, energy) that contribute differentially to collagen synthesis. Recall from Module 1 that bone collagen carbon is derived ~74% from dietary protein and ~26% from energy sources.

For this tutorial: ✓ Check “Include components” — this is essential for routed mixing models

3.4 Include Concentrations?

Concentrations adjust for the fact that different foods have different protein densities. For example:

  • Meat: ~20% protein by weight
  • Cereals: ~10% protein by weight
  • Fish: ~18–20% protein

Without concentration correction, low-protein foods consumed in large quantities may be under-represented in the model.

For this tutorial: ✓ Check “Include concentrations”

Constraint option: ✓ Check “Constrain concentrations 0–100” (ensures percentages remain valid)

3.5 Source Contribution Priors

ReSources uses a Dirichlet distribution to model the proportional contributions of dietary sources (which must sum to 1). You can choose:

3.5.2 User-Defined Dirichlet Prior

Alternatively, you can specify hyperparameters (α values) for the Dirichlet distribution. Higher α values increase the prior weight on a given source.

Example: If historical records suggest heavy reliance on herbivores, you might set:

  • α(herbivores) = 5
  • α(carnivores) = 2
  • α(plants) = 2
  • α(fish 1) = 1
  • α(fish 2) = 1
Use informative priors cautiously

Bayesian priors should be justified by independent evidence (zooarchaeological abundance, historical texts, ethnohistoric accounts). Unjustified priors can bias results toward preconceived conclusions.

3.6 MCMC Execution Settings

These control the Markov Chain Monte Carlo sampling:

Table 2: MCMC settings
Parameter Recommended value Purpose
Burn-in steps 10,000 Discard initial iterations before chains converge
Iterations 50,000 Total MCMC samples per chain
Thinning 5 Keep every 5th sample (reduces autocorrelation)
Number of chains 3 Run multiple chains to assess convergence

For this tutorial: Use the default values shown above

Note: Longer chains (100,000+ iterations) are recommended for final publication-quality analyses


4 Data Input: The Five Key Tables

Navigate to the Data tab. ReSources organizes input data into five interconnected tables:

  1. Target — consumer isotope values
  2. Target to Source Offset — trophic enrichment factors (TEFs)
  3. Sources — dietary source isotope values
  4. Components — routing weights (protein vs. energy)
  5. Concentrations — nutrient densities in sources

4.1 Table 1: Target (Consumer Data)

This table contains the bone collagen isotope measurements for each individual.

4.1.1 Structure

Table 3: Target table structure
Column Description Example value
Individual Unique identifier “Individual 1”
Carbon (mean) δ13C collagen value (‰) −19.5
Carbon (SD) Measurement uncertainty 0.2
Nitrogen (mean) δ15N collagen value (‰) +10.8
Nitrogen (SD) Measurement uncertainty 0.3

4.1.2 Entering Data

You have three options:

Option 1 — Manual entry:
Click “Add row” and type values directly into each cell

Option 2 — Copy-paste from Excel:
Select cells in Excel → Copy → Click “Paste” button in ReSources (or Ctrl+V)

Option 3 — Import CSV/Excel file:
Click “Import Data” → Select file → Map columns

4.1.3 Distribution Type

By default, target values follow a Normal distribution (appropriate for isotope measurements with Gaussian error). Advanced users can select:

  • Constant (no uncertainty)
  • Multivariate Normal (if δ13C and δ15N are correlated)
  • Log-Normal (for ratio data)

For this tutorial: Leave as “Normal” (default)


4.2 Table 2: Target to Source Offset (TEFs)

These are the trophic enrichment factors13C, Δ15N) that account for isotopic fractionation between diet and consumer tissue. Recall from Module 1 that bone collagen is enriched relative to diet by:

  • Δ13C ≈ +1.0 ‰
  • Δ15N ≈ +4.0 ‰

4.2.1 Why TEFs Matter

If a consumer is eating herbivores with δ13C = −21 ‰, the consumer’s bone collagen will not be −21 ‰ due to isotopic fractionation. Instead:

\[ \delta^{13}C_{\text{collagen}} = \delta^{13}C_{\text{diet}} + \Delta^{13}C \]

If Δ13C = +1 ‰, then:

\[ \delta^{13}C_{\text{collagen}} = -21 + 1 = -20 \text{ ‰} \]

4.2.2 ReSources Implementation

In the “Target to Source Offset” table, enter:

Table 4: Typical TEF values for human bone collagen
Proxy Offset (mean) Offset (SD)
Carbon +1.0 0.3
Nitrogen +4.0 1.0
Generic vs. Source-Specific Offsets

Generic offsets (entered here) apply the same TEF to all dietary sources.

Source-specific offsets allow different TEFs for each source (e.g., Δ15N might be higher for low-protein diets). These are entered in a separate table under “Sources → Source Specific Offsets”.

For most archaeological applications, generic offsets are sufficient.


4.3 Table 3: Sources (Dietary End-Members)

This is the most complex table in ReSources. It contains the isotope values for each dietary source, separated by component (protein vs. energy).

4.3.1 Why Separate by Component?

Because the δ13C of protein in a food is often different from the δ13C of carbohydrates/lipids (energy) in the same food. For example:

Table 5: Component-specific isotope values
Food δ¹³C (protein) δ¹³C (energy) Difference
Wheat −26.5 ‰ −25.8 ‰ 0.7 ‰
Cattle meat −21.3 ‰ −22.0 ‰ −0.7 ‰
Marine fish −14.8 ‰ −15.2 ‰ −0.4 ‰

4.3.2 Table Structure

For each dietary source, you must enter:

Carbon proxy:

Source Protein (mean) Protein (SD) Energy (mean) Energy (SD)
Herbivores −21.3 0.7 −22.0 0.9
Carnivores −19.5 0.8 −20.1 1.0
Plants −26.8 1.2 −25.8 0.9
Fish 1 −24.2 1.3 −24.5 1.4
Fish 2 −23.8 1.1 −24.0 1.2

Nitrogen proxy:

Source Protein (mean) Protein (SD)
Herbivores +6.8 1.1
Carnivores +9.2 1.3
Plants +3.5 1.5
Fish 1 +12.5 1.6
Fish 2 +11.8 1.4
Why no “Energy” column for nitrogen?

Because nitrogen is essentially absent from carbohydrates and lipids. Collagen nitrogen is derived 100% from dietary protein, so we only need the protein component for δ15N.

4.3.3 Obtaining Source Data

Source isotope values must come from:

  1. Faunal/botanical reference specimens from the same site/period
  2. Published reference datasets for the region (use cautiously — local variation is common)
  3. Modern analogs (only if depositional/environmental conditions are comparable)
Minimum sample sizes
  • Domesticated animals: n ≥ 10 per species
  • Wild animals/fish: n ≥ 15–20 (higher variability)
  • Plants: n ≥ 10–15

4.4 Table 4: Components (Routing Weights)

This table defines how much of the collagen signal comes from dietary protein vs. energy (carbohydrates + lipids).

4.4.1 The Routing Parameter (λ)

Recall from Module 2 the routed mixing equation:

\[ \delta^{13}C_{\text{collagen}} = \lambda \cdot \delta^{13}C_{\text{protein}} + (1 - \lambda) \cdot \delta^{13}C_{\text{energy}} \]

Where λ (lambda) is the routing parameter. For human bone collagen:

  • λ ≈ 0.74 (i.e., 74% of collagen carbon from dietary protein)
  • (1 − λ) ≈ 0.26 (i.e., 26% from dietary energy)

4.4.2 Components Table Structure

Table 6: Routing weights for human bone collagen
Proxy Protein (mean) Protein (SD) Energy (mean) Energy (SD)
Carbon 0.74 0.08 0.26 0.08
Nitrogen 1.00 0.00 0.00 0.00

Interpretation:

  • Carbon row: 74% of collagen C from protein, 26% from energy (carbs/lipids)
  • Nitrogen row: 100% of collagen N from protein, 0% from energy
Why routing matters: A worked example

Imagine a diet with:

  • 70% maize (C4 plant, δ13C = −12 ‰) by calories (energy)
  • 30% animal protein (δ13C = −21 ‰)

Unrouted model (SIAR, early MixSIAR) would predict: \[ \delta^{13}C_{\text{collagen}} = 0.70 \times (-12) + 0.30 \times (-21) = -14.7 \text{ ‰} \]

Routed model (ReSources) with λ = 0.74: \[ \begin{aligned} \delta^{13}C_{\text{protein}} &= -21 \text{ ‰} \\ \delta^{13}C_{\text{energy}} &= -12 \text{ ‰} \\ \delta^{13}C_{\text{collagen}} &= 0.74 \times (-21) + 0.26 \times (-12) = -18.7 \text{ ‰} \end{aligned} \]

The 4 ‰ difference is substantial! Without routing, you would overestimate maize contribution.


4.5 Table 5: Concentrations

This table records the nutrient density (% protein, % energy) of each dietary source. This is necessary because:

A consumer eating 1 kg of plants vs. 1 kg of meat is consuming different amounts of protein, even though the mass is equal.

4.5.1 Table Structure

Table 7: Example concentration values (% by dry weight)
Source Protein (mean) Protein (SD) Energy (mean) Energy (SD)
Herbivores 20.0 2.0 10.0 1.5
Carnivores 22.0 2.5 15.0 2.0
Plants 8.0 1.5 70.0 5.0
Fish 1 18.0 2.0 8.0 1.5
Fish 2 19.0 2.2 9.0 1.8

Interpretation:

  • Herbivore meat: 20% protein, 10% fat/other energy-dense components
  • Plants: 8% protein, 70% carbohydrates
Where to find concentration data
  • USDA Food Composition Database (modern analogs)
  • Published archaeological/ethnographic studies
  • Nutritional ecology literature

If unavailable, use standard values from nutritional references, but report this assumption.

4.5.2 Distribution Options

Concentrations can follow:

  • Normal (most common)
  • Constant (if assuming no uncertainty)
  • Log-Normal (if concentrations cannot be negative and have right-skewed uncertainty)

For this tutorial: Leave as “Normal” (default)


5 Model Characteristics and Visualization

Before running the MCMC, it’s good practice to visualize the mixing space and check whether your model is well-posed.

Navigate to the Model Characteristics tab.

5.1 Source-Mixture Plot

This tool simulates what consumer isotope values would look like if they consumed 100% of a single source.

STEP 1: Click “Run Simulation”

STEP 2: Wait ~10–30 seconds while ReSources calculates expected ranges

STEP 3: View the 2D plot (if you have 2 proxies: carbon + nitrogen)

The plot shows:

  • Colored regions — expected isotope ranges for consumers eating 100% of each source
  • Mixing polygon — the convex hull encompassing all possible dietary mixtures
  • Actual consumer data — plotted as points

5.1.1 Interpreting the Plot

What to look for

Consumers fall inside the mixing polygon — good! The model is feasible.

Consumers fall outside the polygon — problem! Either:

  1. You’ve missed a dietary source (the “unknown unknowns”)
  2. Your TEF values are wrong
  3. Measurement error in consumers or sources

Action: Revisit your source list and TEF assumptions.

5.2 Custom Mixture Simulation

You can also simulate specific dietary scenarios. For example: “What if someone ate 50% herbivores and 50% carnivores?”

STEP 1: Enter proportions in the “Source Contributions” boxes:

  • Herbivores: 0.50
  • Carnivores: 0.50
  • Plants: 0.00
  • Fish 1: 0.00
  • Fish 2: 0.00

STEP 2: Click “Simulate”

STEP 3: The predicted consumer values appear as a point on the plot


6 Running the Model

You are now ready to execute the Bayesian MCMC simulation.

STEP 1: Navigate to the top of the interface (usually a button labeled “Run Model” or “Execute”)

STEP 2: Click “Run Model”

STEP 3: Wait for:

  • Compilation (JAGS converts your model specification to executable code) — ~10–60 seconds
  • Burn-in (10,000 iterations discarded) — ~30 seconds
  • Sampling (50,000 iterations × 3 chains) — ~1–3 minutes

Total time: 2–5 minutes for this example (larger models take longer)

ReSources vs. FRUITS speed comparison

Small models (≤10 consumers): FRUITS is faster (no compilation step)

Large models (50+ consumers): ReSources is faster (more efficient MCMC sampler)

6.1 Convergence Diagnostics

After the model runs, ReSources automatically checks convergence using the Gelman-Rubin statistic (\(\hat{R}\)).

Convergence criteria

\(\hat{R} < 1.1\) for all parameters → chains have converged (good!)

\(\hat{R} > 1.1\) for some parameters → chains have not mixed properly (bad!)

If convergence fails:

  1. Increase iterations (try 100,000)
  2. Increase burn-in (try 20,000)
  3. Check for data input errors
  4. Check for extremely overlapping sources (non-identifiability)

A summary message will display:

“ReSources run: 1 Monte Carlo chain, 10000 burning steps, 50000 draws, thinning = 5. Model: Independent targets. Convergence diagnostic (Geweke): No convergence failures.”


7 Interpreting Results

Navigate to the Results tab.

7.1 Results Report

The Results Report table displays posterior summaries for all estimated parameters.

7.1.1 Key Estimate Types

  1. Source contributions — proportional contributions of each food to total dietary intake
  2. Source contributions by proxy — contributions to protein intake (via nitrogen) or carbon intake
  3. Component contributions — proportion of diet from protein vs. energy
  4. Concentration estimates — inferred nutrient densities (if concentrations were missing)

7.1.2 Understanding the Output Table

Table 8: Example posterior summaries
Source Individual Estimate Type Mean SD 2.5% 97.5% p-value
Herbivores Individual 1 target 0.42 0.12 0.18 0.65 0.032
Carnivores Individual 1 target 0.15 0.09 0.02 0.35 0.187
Plants Individual 1 target 0.23 0.11 0.05 0.46 0.098
Fish 1 Individual 1 target 0.12 0.08 0.01 0.31 0.245
Fish 2 Individual 1 target 0.08 0.07 0.00 0.25 0.412

Interpretation:

  • Mean = 0.42 → On average, herbivores contributed 42% of total diet
  • SD = 0.12 → Substantial uncertainty (coefficient of variation = 0.12/0.42 = 29%)
  • 95% CI [0.18, 0.65] → Plausible range from 18% to 65%
  • p-value = 0.032 → Bayesian p-value (probability this source contributed 0%)
Wide credible intervals are not “failure”

Wide intervals (e.g., [0.05, 0.85]) reflect genuine uncertainty due to:

  • Overlapping source isotope values
  • High source/consumer measurement error
  • Underdetermined system (too many sources, too few tracers)

This is honest reporting, not model inadequacy.

7.2 Exporting Results

STEP 1: Select desired estimate type from dropdown (e.g., “Source contributions”)

STEP 2: Click “Export”

STEP 3: Choose format:

  • Excel (.xlsx) — for further analysis in spreadsheets
  • CSV — for import into R/Python
  • JSON — for programmatic workflows

8 Visualizing Posterior Distributions

Navigate to Results → Results Plots.

8.1 Plot Options

8.1.1 Display by Estimate

Shows all individuals for a single dietary source.

STEP 1: Select “Display by: Estimate”

STEP 2: Select “Source contributions” from estimate type dropdown

STEP 3: Select “Herbivores” from source dropdown

STEP 4: View boxplots showing herbivore contributions for all individuals

Interpretation:

  • Box = 68% credible interval
  • Whiskers = 95% credible interval
  • Bold line = median
  • Dashed line = mean

8.1.2 Display by Target

Shows all dietary sources for a single individual.

STEP 1: Select “Display by: Target”

STEP 2: Select “Individual 1” from target dropdown

STEP 3: View boxplots comparing all five sources for that individual

8.2 Covariate Comparisons

If you included categorical covariates (e.g., sex, burial context, time period), you can compare group-level estimates.

Example: Do males and females have different herbivore consumption?

STEP 1: Select “Covariate: Sex”

STEP 2: Select “Herbivores” as source

STEP 3: Compare boxplots for males vs. females

Statistical test: Check if 95% CIs overlap. If they do not overlap, there is strong evidence for a difference.


9 Advanced Features

9.1 User-Defined Estimates

You can create custom dietary groupings by combining sources.

9.1.1 Example: Total Meat Consumption

Suppose you want to know the total contribution of all animal protein (herbivores + carnivores + fish):

STEP 1: Navigate to “User Estimates” tab

STEP 2: Click “Add New Estimate”

STEP 3: Enter name: Total_Meat

STEP 4: Select sources to include:

  • ✓ Herbivores
  • ✓ Carnivores
  • ✓ Fish 1
  • ✓ Fish 2
  • ✗ Plants

STEP 5: Check “Normalize” (ensures Total_Meat + Plants = 100%)

STEP 6: Click “Apply”

The new estimate Total_Meat now appears in the results tables and plots.

9.2 Applying Prior Constraints

You can impose inequality constraints based on prior knowledge.

9.2.1 Example: Herbivores > Carnivores

If zooarchaeological evidence suggests herbivore bones outnumber carnivore bones 3:1, you might constrain:

\[ \text{Herbivores} > \text{Carnivores} \]

STEP 1: Navigate to “User Estimates”“Constraints”

STEP 2: Select “Herbivores” from dropdown 1

STEP 3: Select “>” (greater than)

STEP 4: Select “Carnivores” from dropdown 2

STEP 5: Optionally add uncertainty to this constraint (softens it from a hard rule to a probabilistic prior)

STEP 6: Click “Add Constraint”

Use constraints judiciously

Constraints should be based on independent archaeological evidence, not circular reasoning. Document your justification clearly in publications.


10 Convergence Diagnostics and Model Validation

Navigate to Model Diagnostics tab.

10.1 Trace Plots

Trace plots show the MCMC chain history for each parameter. Good convergence looks like:

“Hairy caterpillar” — rapid mixing across the parameter space
Trending — chain is still “burning in” (increase burn-in)
Stuck — chain is trapped in a local mode (increase iterations; check for non-identifiability)

STEP 1: Select “Trace Plot” from diagnostic dropdown

STEP 2: Select “Source contributions”“Herbivores”“Individual 1”

STEP 3: Examine the plot for all 3 chains (should overlap and mix well)

10.2 Gelman-Rubin Statistic (\(\hat{R}\))

For each parameter, \(\hat{R}\) compares within-chain variance to between-chain variance:

  • \(\hat{R} \approx 1.0\) → chains have converged to the same posterior
  • \(\hat{R} > 1.1\) → chains disagree; convergence failure

Navigate to Goodness of Fit TestsConvergence Tests → View \(\hat{R}\) values

10.3 Effective Sample Size (ESS)

ESS measures how many independent samples your MCMC chains produced (after accounting for autocorrelation).

  • ESS > 1000 → good
  • ESS = 100–1000 → acceptable
  • ESS < 100 → poor (increase iterations or thinning)

11 Goodness-of-Fit Tests

Navigate to Goodness of Fit Tests tab.

11.1 Bayesian p-value

For each consumer, ReSources calculates a Bayesian p-value that tests:

“How probable is the observed consumer isotope value given the posterior dietary estimates?”

  • p ≈ 0.50 → observed value is typical (good fit)
  • p < 0.05 or p > 0.95 → observed value is extreme (poor fit; model may be misspecified)
Interpreting poor fit

If several individuals have extreme p-values:

  1. Check for outliers in consumer data (transcription errors?)
  2. Re-examine source list (missing sources?)
  3. Review TEF values (are they appropriate for this population?)

11.2 Information Criteria (DIC, WAIC)

Deviance Information Criterion (DIC) and Widely Applicable Information Criterion (WAIC) allow you to compare alternative models:

Table 9: Model comparison example
Model variant DIC WAIC Preferred?
5 sources, routed 245.3 248.1
5 sources, unrouted 312.7 315.4
4 sources (fish pooled) 248.9 251.2 ~

Rule: Lower DIC/WAIC = better model fit. Differences of >10 are considered substantial.


12 Practical Tips and Troubleshooting

12.1 Common Error Messages

12.1.1 “Model did not compile”

Cause: Data inconsistency (e.g., proxy names don’t match between tables)

Fix: Check that “Carbon” and “Nitrogen” are spelled identically in:

  • Target table (column headers)
  • Sources table (proxy tabs)
  • Components table (proxy names)
  • Target to Source Offset table

12.1.2 “Convergence failure for Individual X”

Cause:

  1. Source isotope values are extremely overlapping → posterior is multimodal
  2. Consumer value is outside the mixing space
  3. Insufficient MCMC iterations

Fix:

  1. Pool similar sources (e.g., Fish 1 + Fish 2 → “Fish”)
  2. Check consumer data for errors
  3. Increase iterations to 100,000 or 200,000

12.1.3 “Negative concentration values sampled”

Cause: You allowed Normal distributions for concentrations, which can sample negative values

Fix: Check “Constrain concentrations 0–100” in Core Model Options

12.2 Performance Optimization

12.2.1 For Large Datasets (n > 50 consumers)

  • Use “Pooled targets” or “Hierarchical” model to share information across individuals
  • Reduce thinning to 3 (more samples, slight increase in autocorrelation)
  • Run chains in parallel (if your machine has multiple cores)

12.2.2 For Slow Computers

  • Reduce iterations to 30,000
  • Use 2 chains instead of 3
  • Disable real-time plotting during MCMC (speeds up execution)

13 Learning Outcomes Checklist

By the end of this hands-on session you should be able to:

  1. Launch the ReSources GUI and load a predefined example dataset
  2. Configure core model options: model type, priors, components, concentrations, MCMC settings
  3. Enter and validate data in all five key tables: Target, Target to Source Offset, Sources, Components, Concentrations
  4. Explain why routed mixing models are necessary for bone collagen analysis (protein vs. energy routing)
  5. Visualize the mixing space and check model feasibility using the Source-Mixture Plot
  6. Run a Bayesian MCMC simulation and interpret the convergence diagnostics (Gelman-Rubin \(\hat{R}\))
  7. Interpret posterior distributions: mean, median, standard deviation, 95% credible intervals
  8. Create user-defined estimates by combining dietary sources (e.g., “Total meat”)
  9. Apply prior constraints based on archaeological evidence (e.g., Herbivores > Carnivores)
  10. Export results to Excel/CSV for further analysis and publication
  11. Diagnose and troubleshoot common errors (convergence failure, data inconsistencies)

14 Summary of ReSources Workflow

Code
flowchart TD
    A[1. Load ReSources GUI] --> B[2. Configure Core<br/>Model Options]
    B --> C[3. Enter Target<br/>consumer data]
    C --> D[4. Enter Target to Source<br/>Offset TEFs]
    D --> E[5. Enter Sources<br/>food isotope values]
    E --> F[6. Enter Components<br/>routing weights]
    F --> G[7. Enter Concentrations<br/>nutrient densities]
    G --> H[8. Visualize Mixing Space<br/>Model Characteristics]
    H --> I{Data valid?}
    I -->|No| J[Revise sources<br/>or TEFs]
    J --> C
    I -->|Yes| K[9. Run MCMC<br/>Bayesian simulation]
    K --> L[10. Check Convergence<br/>Gelman-Rubin Rhat]
    L --> M{Converged?}
    M -->|No| N[Increase iterations<br/>or pool sources]
    N --> K
    M -->|Yes| O[11. Interpret Posteriors<br/>means, CIs, p-values]
    O --> P[12. Create User Estimates<br/>custom groupings]
    P --> Q[13. Export Results<br/>Excel/CSV/JSON]
    Q --> R[14. Publication]
    
    style A fill:#D6ECEE
    style K fill:#FFF3DF
    style O fill:#C1E1C1
    style R fill:#E8F5E9
Figure 1: Complete ReSources workflow from data preparation to result interpretation

15 Recommended Next Steps

15.1 After This Tutorial

  1. Work with your own data — prepare CSV files for your archaeological population
  2. Conduct sensitivity analyses — vary TEF values, routing parameter λ, and compare results
  3. Read the ReSources paper — Fernandes et al. (2021) Science Advances DOI: 10.1126/sciadv.abg5791
  4. Join the ReSources community — post questions on the GitHub Issues page
  5. Explore advanced features — covariate models, hierarchical structures, custom priors

15.2 Further Resources

  • ReSources GitHub: https://github.com/EISALab/ReSources
  • JAGS User Manual: https://mcmc-jags.sourceforge.io/
  • Bayesian Mixing Model Review: Phillips et al. (2014) Canadian Journal of Zoology 92:823–835

End of Module 3 — Lunch break 12:00–13:00

Afternoon session continues with archaeological case studies and publication-ready analyses